package sdufe.lele.result;


/**
 * Created by olivia on 3/22/2017.
 */


import org.springframework.stereotype.Repository;

/**
 * 错误返回
 */
@Repository
public class ApiError extends Result {
    private String message;


    public ApiError(String message, int status) {
        super(status);
        this.message = message;
    }

    public ApiError() {
        super(500);
        this.message = "";
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    /**
     * 没通过身份验证
     *
     * @return Error
     */
    public static ApiError unAuthenticate() {
        return new ApiError("Authenticate Error", 403);
    }

}
